// pages/itemMessage/itemMessage.js
var app = getApp()
var baseUrl = app.globalData.baseUrl
Page({

  /**
   * 页面的初始数据
   */
  data: {
    items:[],
    publisher:[]
  },

  onLoad(options) {
    let itemId = options.itemId
    wx.cloud.database().collection('lostItem').doc(itemId).get({
      success: res =>{
        this.setData({
          items: res.data
        })
        wx.request({
          url: baseUrl+'user/getUserInfo/'+res.data._openid,
          method: 'GET',
          success: res => {
            this.setData({
              publisher: res.data
            })
            console.log('用户',res.data)
          }
        })
      }
    })
  },

  onShow() {

  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})